package com.gongpingjialoan.activity.main;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.gongpingjialoan.R;
import com.gongpingjialoan.activity.tool.WebViewActivity;
import com.gongpingjialoan.global.GPJApplication;

/**
 * Created by Administrator on 2016/3/30.
 */
public class AboutActivity extends BaseActivity {

    TextView introduceTextView, phoneTextView, versionTextView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.about);
        setTitle("关于公平价");
        introduceTextView = (TextView) findViewById(R.id.introduce);
        phoneTextView = (TextView) findViewById(R.id.phone);
        versionTextView = (TextView) findViewById(R.id.version);
        versionTextView.setText("V " + GPJApplication.getInstance().version);
        introduceTextView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(AboutActivity.this, WebViewActivity.class);
                intent.putExtra("url", "http://m.gongpingjia.com/static/about_us/aboutus.html");
                intent.putExtra("content", "公平价介绍");
                startActivity(intent);
            }
        });
        phoneTextView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + "4000253500"));
                startActivity(intent);
            }
        });

//        final PriceRegionView priceRegionView = (PriceRegionView) findViewById(R.id.region);
//        final RLScrollView rlScrollView = (RLScrollView) findViewById(R.id.rl);
//        rlScrollView.setOnScrollListener(new RLScrollView.OnScrollListener() {
//            @Override
//            public void onScrollChanged(int x, int y, int oldX, int oldY) {
//                boolean visible = rlScrollView.isChildVisible(priceRegionView);
//                if (visible) {
//                    if (!priceRegionView.running && !priceRegionView.isAnmi) {
//                        priceRegionView.start();
//                    }
//                } else {
//                    if (!priceRegionView.running && priceRegionView.isAnmi) {
//                        priceRegionView.reset();
//                    }
//                }
//            }
//
//            @Override
//            public void onScrollStopped() {
//
//            }
//
//            @Override
//            public void onScrolling() {
//
//            }
//        });
    }
}
